# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.IdentityToolkit.V3.Model.CreateAuthUriResponse do
  @moduledoc """
  Response of creating the IDP authentication URL.

  ## Attributes

  *   `allProviders` (*type:* `list(String.t)`, *default:* `nil`) - all providers the user has once used to do federated login
  *   `authUri` (*type:* `String.t`, *default:* `nil`) - The URI used by the IDP to authenticate the user.
  *   `captchaRequired` (*type:* `boolean()`, *default:* `nil`) - True if captcha is required.
  *   `forExistingProvider` (*type:* `boolean()`, *default:* `nil`) - True if the authUri is for user's existing provider.
  *   `kind` (*type:* `String.t`, *default:* `identitytoolkit#CreateAuthUriResponse`) - The fixed string identitytoolkit#CreateAuthUriResponse".
  *   `providerId` (*type:* `String.t`, *default:* `nil`) - The provider ID of the auth URI.
  *   `registered` (*type:* `boolean()`, *default:* `nil`) - Whether the user is registered if the identifier is an email.
  *   `sessionId` (*type:* `String.t`, *default:* `nil`) - Session ID which should be passed in the following verifyAssertion request.
  *   `signinMethods` (*type:* `list(String.t)`, *default:* `nil`) - All sign-in methods this user has used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allProviders => list(String.t()) | nil,
          :authUri => String.t() | nil,
          :captchaRequired => boolean() | nil,
          :forExistingProvider => boolean() | nil,
          :kind => String.t() | nil,
          :providerId => String.t() | nil,
          :registered => boolean() | nil,
          :sessionId => String.t() | nil,
          :signinMethods => list(String.t()) | nil
        }

  field(:allProviders, type: :list)
  field(:authUri)
  field(:captchaRequired)
  field(:forExistingProvider)
  field(:kind)
  field(:providerId)
  field(:registered)
  field(:sessionId)
  field(:signinMethods, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.IdentityToolkit.V3.Model.CreateAuthUriResponse do
  def decode(value, options) do
    GoogleApi.IdentityToolkit.V3.Model.CreateAuthUriResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.IdentityToolkit.V3.Model.CreateAuthUriResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
